<template>
  <div id="threeMeals" v-if="threeMeals.palteTabList">
    <div class="title">
      <p>{{ threeMeals.name }}</p>
      <p>
        <a href="javascript:void(0)"  v-for="(item) in threeMeals.palteTabList" :key="item.id"><span>{{item.name}}</span></a>
      </p>
    </div>
    <div id="threeMealsContent">
      <div class="banner">
        <swiper style="width:'100%';height:'100%'" :pcBannerList="threeMeals.wheelSeedingList"></swiper>
      </div>
      <dl class="content1">
        <dt>
          <img :src="threeMeals.platePicList[0].imgUrl" />
        </dt>
        <dt>
          <img :src="threeMeals.platePicList[1].imgUrl" />
        </dt>
      </dl>
      <dl class="content2">
        <dd v-for="item in threeMeals.goodsList" :key="item.id" @click="$routeJump(item.goodsId)">
          <div v-if="item.pmList" class="isNew">
            <div>折扣</div>
          </div>
          <div v-else-if="item.isNew==1" class="isNew">
            <div>新品</div>
          </div>
          <div class="goods-img">
            <img :src="item.imgUrl" >
          </div>
          <div class="goods-name">{{ item.goodsName }}</div>
          <div class="goods-price">{{$commonMethod(item.price)}}</div>
          <div style="height: 20px"></div>
        </dd>
      </dl>
    </div>
  </div>
</template>

<script>
import swiper from './swiper.vue'
export default {
  name: "ThreeMeals",
  props: {
    threeMeals: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  components: { swiper },
}
</script>

<style scoped>
  dl,dt,dd {
  margin: 0;
  padding: 0;
  }
    #threeMeals {
      width: 1200px;
      margin: 0 auto;
    }
    #threeMeals > .title {
      height: 40px;
      display: flex;
      justify-content: space-between;
      margin: 40px 0 20px;
    }
    #threeMeals > .title > p {
      margin: 0;
      color: #333;
      font-size: 26px;
      line-height: 40px;
    }
    #threeMeals > .title > p span {
      color: #333;
      font-size: 16px;
    }
    #threeMeals > .title > p span:hover {
      color: #0099a8;
    }
    #threeMeals > .title > p span::after {
      content: " / ";
    }
    #threeMeals > .title a:last-of-type > span::after {
      content: "";
    }
    #threeMealsContent > .banner {
      width: 100%;
      margin-bottom: 10px;
      height: 260px;
    }
    #threeMealsContent > .content1 {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      padding-bottom: 10px;
    }
    #threeMealsContent > .content1 > dt {
      display: flex;
      height: 330px;
      width: 595px;
      margin-top: 12px;
      justify-content: space-evenly;
    }
    #threeMealsContent > .content1 > dt > img {
      height: 330px;
      width: 595px;
      vertical-align: middle;
      background-size: cover;
    }
    #threeMealsContent > .content2 {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      cursor: pointer;
    }
    #threeMealsContent > .content2 > dd {
      background: #fff;
      margin-bottom: 10px;
      position: relative;
      width: 291px;
    }
    #threeMealsContent > .content2 > dd > .isNew {
      display: flex;
      flex-direction: column;
      height: 45px;
      min-height: 20px;
      position: absolute;
      width: 50px;
      z-index: 100;
    }
    #threeMealsContent > .content2 > dd > .isNew > div {
      background-color: #ff4157;
      color: #fff;
      font-size: 12px;
      margin: 10px 0 0 10px;
      padding: 2px 5px;
      text-align: center;
      width: 50px;
    }
    #threeMealsContent > .content2 > dd > .goods-img {
      box-sizing: border-box;
      height: 280px;
      overflow: hidden;
      text-align: center;
    }
    #threeMealsContent > .content2 > dd > .goods-img > img {
      width: 250px;
      height: 250px;
      padding-top: 20px;
      transition: all .6s;
      object-fit: cover;
    }
    #threeMealsContent > .content2 > dd > .goods-name {
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      color: #333;
      display: -webkit-box;
      font-weight: 400;
      margin: 0 auto;
      overflow: hidden;
      padding-top: 10px;
      text-overflow: ellipsis;
      width: 90%;
      text-align: start;
    }
    #threeMealsContent > .content2 > dd > .goods-price {
      color: #fc3538;
      font-size: 14px;
      font-weight: 600;
      margin: 10px auto;
      width: 90%;
      text-align: left;
    }
</style>